package kr.hkit.powerjava.chapter09;

class Time {

	private int hour;
	private int min;
	private int sec;
	


	
	public Time(int hour, int min, int sec) {
		this.hour = hour;
		this.min = min;
		this.sec = sec;
	}
	
	public void setTime(int h, int m, int s) {
		this.hour = ((h>=0 && h<24)? h:0);
		this.min = ((m>=0 && m<60)? m:0);
		this.sec = ((s>=0 && s<60)? s:0);
		
	}
	

	@Override
	public String toString() {
		return "Time [hour=" + hour + ", min=" + min + ", sec=" + sec + "]";
	}
	
}
